<?php use_stylesheet('teams.css') ?>

<h1><?php echo $pronos_group->getName() ?></h1>
<div id="teams">
<table class="teams">
<tr align="center">
	<th colspan="2">Equipes</th>
	<th>Jou&eacute;s</th>
	<th>Gagn&eacute;s</th>
	<th>Nuls</th>
	<th>Perdus</th>
	<th>BP</th>
	<th>BC</th>
	<th>+/-</th>
	<th><b>Pts</b></th>
	
</tr>
    <?php
		$i=0;
		foreach ($standings as $standing): 
	$i++;
			$pronos_team = $standing->getPronosTeam();
			
			$pts = $standing->getNbPts();
			$nbWin = $standing->getNbWon();
			$nbNul = $standing->getNbNul();
			$nbLost = $standing->getNbLost();
			$nbPlayed = $standing->getNbPlayed();
			$nbBP = $standing->getNbBP();
			$nbBC = $standing->getNbBC();
	?>
	    <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
		<td><img src="/pronos/images/teams/<?php echo strtolower($pronos_team->getCode()) ?>.gif" /></td>
		<td class="position">
			<a href="<?php echo url_for('team/show?id='.$pronos_team->getId()) ?>">
				<?php echo $pronos_team->getName() ?>
			</a>
		</td>
		<td class="position" align="center"><?php echo $nbPlayed ?></td>
		<td class="position" align="center"><?php echo $nbWin ?></td>
		<td class="position" align="center"><?php echo $nbNul ?></td>
		<td class="position" align="center"><?php echo $nbLost ?></td>
		<td class="position" align="center"><?php echo $nbBP ?></td>
		<td class="position" align="center"><?php echo $nbBC ?></td>
		<td class="position" align="center"><?php echo $nbBP - $nbBC ?></td>
		<td class="position" align="center"><b><?php echo $pts ?></b></td>
		</tr>
	<?php endforeach ?>
</table>
</div>
<br/>

<h1>Matchs du <?php echo $pronos_group->getName() ?></h1>
<div id="teams">
<table class="teams">

    <?php 
		$matches = $pronos_group->getP1Matchs();
			
		foreach ($matches as $i => $pronos_match): 
			$result = $pronos_match->getP1Result();	?>
	    <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
				<!--td ><?php echo $pronos_match->getId() ?></td-->
				<td class="position" align="center"><?php echo $pronos_match->getFDate('d/m H:i') ?></td>
			    <td><img src="/pronos/images/teams/<?php echo strtolower($pronos_match->getTeam1()->getCode()) ?>.gif" /></td>
				<td align="right"><?php echo $pronos_match->getTeam1()->getName() ?></td>
				<td align="right"><?php echo $result->getScore1() ?></td>
				<td align="center">&nbsp;-&nbsp;</td>
				<td align="right"><?php echo $result->getScore2() ?></td>
				<td align="left"><?php echo $pronos_match->getTeam2()->getName() ?></td>
				<td><img src="/pronos/images/teams/<?php echo strtolower($pronos_match->getTeam2()->getCode()) ?>.gif" /></td>
		</tr>
	<?php endforeach ?>
</table>
</div>